home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / pctj8506.arc / TRYDIR.C < prev    next >
Text File  |  1986-09-14  |  640b  |  23 lines

  1. /* trydir.c - try directory scan functions - Ctools2 */
  2. #include "stdio.h"
  3. #include "direct.h"
  4. char spec[80] ;
  5.  
  6. main()
  7.  {
  8.     int ret , attr ;
  9.     FSPEC dir ;
  10.  
  11.     printf(" spec and attr(Hex): \n");
  12.     scanf("%s %x",spec,&attr) ;
  13.     printf("\n\n");
  14.  
  15.     ret = drsfirst(spec,attr,&dir) ; /* get 1st file entry*/
  16.     while( ret == 0 )        /* repeat til search fails */
  17.       { printf(" %s   %8ld bytes   attr=%02x \n",
  18.            dir.fname , dir.fsize , dir.fattr) ;
  19.         ret = drsnext(&dir) ;    /* get next file entry */
  20.       }
  21.     printf("\n ret = %d \n",ret) ;
  22.  }
  23.